<%@page contentType="text/html"
        import="oracle.portal.provider.v2.render.PortletRenderRequest,
                oracle.portal.provider.v2.http.HttpCommonConstants,
                oracle.portal.provider.v2.personalize.NameValuePersonalizationObject,
                oracle.portal.provider.v2.render.PortletRendererUtil"
%>

<%
PortletRenderRequest pReq = (PortletRenderRequest)
request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);

String actionParam = PortletRendererUtil.getEditFormParameter(pReq);
String action = request.getParameter(actionParam);
String title = request.getParameter("telnet_portlet_title");
String host = request.getParameter("host");
NameValuePersonalizationObject data = (NameValuePersonalizationObject)
                                        PortletRendererUtil.getEditData(pReq);

// Cancel automatically redirects to the page, so
// will only recieve OK or APPLY
if (action != null)
{
     data.setPortletTitle(title);
     data.putString("host", host);
     PortletRendererUtil.submitEditData(pReq, data);
     return;
}

// Otherwise just render the form.
title = data.getPortletTitle();
host = data.getString("host");
if (host==null) host="";
%>
<table width='99%' cellspacing='0' cellpadding='0'>
  <tr>
    <td><nobr><font class='OraHeaderSub'>Portlet Preferences</font></nobr><img src="/images/beigepx.gif" border="0" height="1" width="100%"></td>
  </tr>
  <tr class='OraInstructionText'>
    <td>
      Specify the portlet's title and the host server to connect to.
    </td>
  </tr>
  <tr>
    <td>
      <blockquote>
        <table>
          <tr>
            <td>
              <font class='OraInstructionText'>Title</font>
            </td>
            <td>
              <input class='OraInstructionText' type="TEXT" 
                     name="telnet_portlet_title" value="<%= title %>">
            </td>
          </tr>
          <tr>
            <td>
              <font class='OraInstructionText'>Host</font>
            </td>
            <td>
              <input class='OraInstructionText' type="TEXT" 
                     name="host" value="<%= host %>">
            </td>
          </tr>
        </table>
      </blockquote>
    </td>
  </tr>
</table>
